//
//  LSDrawerController.h
//  LSDrawerExample
//
//  Created by LuckyStrike on 2018/3/26.
//  Copyright © 2018年 LuckyStrike. All rights reserved.
//

#import <UIKit/UIKit.h>

/**
 *  开启抽屉收拾：刨除导航栏范围以及 只限做边界滑动  （BezelPanningCenterView）
 */

/**
 *  关闭抽屉收拾： 1.滑动内容页整页
                2.滑动抽屉页    ***取消***
                3.点击内容页
 */
//  抽屉开启时内容页完全无手势

typedef struct _LSRange {
    CGFloat startValue;
    CGFloat endValue;
}LSRange;

NS_INLINE LSRange LSMakeRange(CGFloat startValue, CGFloat endValue) {
    LSRange r;
    r.startValue = startValue;
    r.endValue = endValue;
    return r;
}

@protocol LSDrawerDelegate<NSObject>

- (void)drawerDidSelected:(UIViewController*)contentController index:(NSInteger)index;

@end

@interface LSDrawerController : UIViewController

/**   */
@property (nonatomic,weak) id<LSDrawerDelegate> delegate;

@property (nonatomic, assign) CGFloat bezelPanningCenterViewRange;
/**   */
@property (nonatomic,copy) NSArray<UIViewController*> *contentControllers;
/**   */
@property (nonatomic,strong) UIViewController *drawerController;
/**   */
@property (nonatomic,assign) CGFloat drawerWidth;
/**   */
@property (nonatomic,assign) BOOL shouldStretchDrawer;
/**   */
@property (nonatomic,assign) CGFloat stretchDrawerWidth;

/**   */
@property (nonatomic) LSRange contentShadowRadiusRange;
/**   */
@property (nonatomic) LSRange contentShadowOpacityRange;


/**   */
@property (nonatomic,assign) NSInteger selectedIndex;
/**   */
@property (nonatomic,readonly,strong) UIViewController *selectedViewContoller;
/**
 The animation velocity of the open and close methods, measured in points per second.
 
 By default, this is set to 840 points per second (three times the default drawer width), meaning it takes 1/3 of a second for the `centerViewController` to open/close across the default drawer width. Note that there is a minimum .1 second duration for built in animations, to account for small distance animations.
 */
@property (nonatomic, assign) CGFloat animationVelocity;
/**
 The value determining if the user can open or close drawer with panGesture velocity.
 
 By default, this is set 200.0f.
 */
@property (nonatomic, assign) CGFloat panVelocityXAnimationThreshold;


/**   */
@property (nonatomic,assign) CGFloat contentScale;


#pragma mark -- 方法

- (void)toggleDrawerAnimated:(BOOL)animated completion:(void(^)(BOOL finished))completion;

/**
 Closes the open drawer.
 
 @param animated Determines whether the drawer side should be closed animated
 @param completion The block that is called when the close is complete
 
 */
-(void)closeDrawerAnimated:(BOOL)animated completion:(void(^)(BOOL finished))completion;

/**
 Opens the `drawer` passed in.
 
 @param animated Determines whether the `drawer` should be open animated.
 @param completion The block that is called when the toggle is open.
 
 */
- (void)openDrawerAnimated:(BOOL)animated completion:(void(^)(BOOL finished))completion;

- (void)exchangeSelectedIndex:(NSInteger)index animated:(BOOL)animated completion:(void(^)(BOOL finished))completion;



@end
